import {BASEURL} from '@/services/api'
import {request, METHOD} from '@/utils/request'

/*
* 获取所有的分类
* */
export async function getCates(){
    return request(BASEURL+'/category/cates',METHOD.GET)
}
/*
* 添加分类
* */
export async function addCate(name){
    return request(BASEURL+'/category/addCate',METHOD.POST,{
        name:name
    })
}

/*
* 根据id 获取类别信息
* */
export async function getCateById(id){
    return request(BASEURL+'/category/getById/'+id,METHOD.GET,{
        id:id
    })
}

/*
* 根据ID删除类别信息
* */
export async function deleteCateById(id){
    return request(BASEURL+'/category/deleteById/'+id,METHOD.DELETE,{
        id:id
    })
}

/*
* 修改列表状态
* */
export async function updateStatus(id){
    return request(BASEURL+'/category/updateStatus/'+id,METHOD.GET,{
        id:id
    })
}

/*
* 修改类别信息
* */
export async function updateInfo(id,name){
    return request(BASEURL+'/category/updateCate',METHOD.POST,{
        id:id,
        name:name
    })
}

